<?
require_once("../config/dbconn.php");require_once("../config/usercls.php");
if ($act=='chkusername'){
	$return=0;
	$sqlc="select id from {$db_prefix}users where username='$username'";
	$rsc=$db->get_one($sqlc);
	if ($rsc['id']) $return=0;else $return=1;
	echo "send_success:".$return;
}
if ($act=='chktjuser'){
	$return=0;
	$sqlc="select id from {$db_prefix}users where username='$tjuser'";
	$rsc=$db->get_one($sqlc);
	if (!$rsc['id'])
	{
		$return=0;
	}else
	{
		if($rsc['fhstata']==1){
			$return=2;
		}else{
			$return=1;
		}
	}
	echo "send_success:".$return;
}
if ($act=='chkgluser'){
	$return=0;
	$sqlc="select id from {$db_prefix}users where username='$gluser'";
	$rsc=$db->get_one($sqlc);
	if ($rsc['id']){
		$return=1;
		if ($pos){
			$sqlp="select id from {$db_prefix}users where gluser='$gluser' and pos='$pos'";
			$rsp=$db->get_one($sqlp);
			if (!$rsp['id']) $return=2;else $return=3;
		}
	}
	echo "send_success:".$return;
}
if ($act=='chkpos'){
	$return=0;
	$sqlc="select id from {$db_prefix}users where username='$gluser'";
	$rsc=$db->get_one($sqlc);
	if ($rsc['id']){
		$sqlp="select id from {$db_prefix}users where gluser='$gluser' and pos='$pos'";
		$rsp=$db->get_one($sqlp);
		if (!$rsp['id']) $return=1;else $return=2;
	}
	echo "send_success:".$return;
}
if ($act=='chkbduser'){
	$return=0;
	$sqlc="select id from {$db_prefix}users where username='$bduser' and isdp=1";
	$rsc=$db->get_one($sqlc);
	if ($rsc['id']) $return=1;
	echo "send_success:".$return;
}
?>